package featuresdemo;

//-128~127之外的integer将会new一个，而不是从缓存中取出
//所以，范围之外的integer 用==号判断时是不等的
public class AutoBoxing128 {

	public static void main(String[] args) {
		Integer a = 55;
		Integer b = 55;
		
		System.out.println("==:" + (a == b));

		//bigger than 128 will create a new instance
		Integer c = 255;
		Integer d = 255;
		System.out.println("==:" + (c == d));
		System.out.println("equals:" + (c.equals(d)));
		
		System.out.println("smaller than? " + ( a<c));
		
		Float x = 4.35f;
		Float y = 4.35f;
		System.out.println("equals: " + (x.equals(y)));
		System.out.println("smaller than? " + ( a<x));
	}

}
